﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using AppAcc.Views.BaoCaoChungTu;

namespace AppAcc.FormDieuKien
{
    public partial class FormSoTHNhapXuat : Form
    {
        public FormSoTHNhapXuat()
        {
            InitializeComponent();
        }

        private void FormSoTHNhapXuat_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'dS_GetListTaiKhoan.TaiKhoan' table. You can move, or remove it, as needed.
            this.taiKhoanTableAdapter.Fill(this.dS_GetListTaiKhoan.TaiKhoan);
            cbX_TaiKhoan.DropDownColumns = "Id";
            getListTenTaiKhoan();

        }

        private void bt_BaoCao_Click(object sender, EventArgs e)
        {
            Views.BaoCaoChungTu.FormBaoCaoNhapXuatTongHop f=new FormBaoCaoNhapXuatTongHop(cbX_TaiKhoan.SelectedValue.ToString(),dateTimePicker1.Value,dateTimePicker2.Value);
            f.ShowDialog();
        }

        private void cbX_TaiKhoan_SelectedIndexChanged(object sender, EventArgs e)
        {
            getListTenTaiKhoan();
          
        }

        void getListTenTaiKhoan()
        {
            this.pr_GetListTenTaiKhoanTableAdapter.Fill(this.dS_GetListTenTK.pr_GetListTenTaiKhoan,
              cbX_TaiKhoan.SelectedValue.ToString());
        }
    }
}
